<template>
  <img
    src="~@/assets/images/bigscreen/toleft.png"
    v-if="isToLeft"
    @click="change"
  />
  <img src="~@/assets/images/bigscreen/toright.png" v-else @click="change" />
</template>
<script setup>
const props = defineProps({
  isToLeft: Boolean,
});
const isLeft = ref(true);
watch(
  () => props.isToLeft,
  (val) => {
    isLeft.value = props.isToLeft;
  },
);
const emit = defineEmits(["change"]);
const change = () => {
  isLeft.value = !isLeft.value;
  emit("change", !isLeft.value);
};
</script>
<style scoped lang="less">
img {
  width: 28px;
  height: 45px;
}
</style>
